#include "../../common/httplib.h"
int main()
{
    httplib::Server server;
    //注册回调函数
    server.Get("/hi", [](const httplib::Request &req, httplib::Response &res) {
        std::cout << "req.method: " << req.method << std::endl;
        std::cout << "req.path: " << req.path << std::endl;
        for(auto it: req.headers)
        {
            std::cout << it.first << ": " << it.second << std::endl;
        }
        std::string body  = "<html><body><h1>Hello,you are a good one!</h1></body></html>";
        res.set_content(body, "text/html");
    });

    server.listen("0.0.0.0", 9090);
}